<template>
    <view class="content">
        <image src="../../static/image/s_logo.png" class="s-logo"></image>
        <view class="top">
            <image :src="info.service_img" class="avatar"></image>
            <view>{{info.name}}</view>
        </view>
        
        <view class="box">
            <view class="item">
                <view>姓名</view>
                <view class="item-r">{{info.name}}</view>
            </view>
            <view class="item">
                <view>性别</view>
                <view class="item-r">{{info.gender == 1 ? '男' : '女'}}</view>
            </view>
            <view class="item">
                <view>年龄</view>
                <view class="item-r">{{info.age}}</view>
            </view>
            <view class="item">
                <view>出生年月日</view>
                <view class="item-r">{{info.birthday}}</view>
            </view>
            <view class="item">
                <view>手机号</view>
                <view class="item-r">{{info.mobile}}</view>
            </view>
            <view class="item">
                <view>学历</view>
                <view class="item-r">{{info.education}}</view>
            </view>
            <view class="item">
                <view>就读院校</view>
                <view class="item-r">{{info.school}}</view>
            </view>
        </view>
    </view>
</template>

<script>
    import { IMAGEURL } from '@/static/js/common.js';
    export default {
        data() {
            return {
                IMAGEURL,
                info: {},
            };
        },
        onLoad() {
            this.getInfo()
        },
        methods: {
            //预览照片
            // doPreview(item, index) {
            //     let arr = []
            //     arr.push(item)
            //     uni.previewImage({
            //         urls: arr,
            //         current: index,
            //         longPressActions: {
            //             success: function(data) {
            //             },
            //             fail: function(err) {
            //             }
            //         }
            //     });
            // },
            
            getInfo() {
            	this.$ajax('companion_detail', {
            		user_token: this.$getSync('userToken'),
            	}).then(ret => {
            		if (ret.success == 1000) {
                        this.info = ret.detail
            		} else {
            			this.$toast(ret.msg);
            		}
            	});
            },
        }
    };
</script>

<style lang="scss">
    
    
    
    
    page{
        background-color: #f5f5f5;
    }
    .content{
        padding: 45rpx 25rpx;
    }
    .s-logo{
        width: 417rpx;
        height: 168rpx;
        position: absolute;
        top: 35rpx;
        left: 50%;
        transform: translateX(-50%);
        z-index: -1;
    }
    .top{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 45rpx 0;
        font-size: 32rpx;
        font-weight: bold;
    }
    .avatar{
        width: 127rpx;
        height: 127rpx;
        border: 2rpx solid #fff;
        border-radius: 50%;
        margin-bottom: 15rpx;
        box-shadow: 2px 2px 5px #eaedf4;
    }
    
    .title{
        font-size: 32rpx;
        font-weight: bold;
        padding-bottom: 20rpx;
    }
    .box{
        padding: 0 30rpx;
        background-color: #fff;
        border-radius: 15rpx;
        margin-bottom: 40rpx;
    }
    .item{
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2rpx solid #e6e6e6;
        padding: 35rpx 0;
    }
    .item:last-child{
        border-bottom: none;
    }
    .item-r{
        flex: 1;
        text-align: right;
        padding-left: 15rpx;
    }
    
    .sub{
        font-size: 28rpx;
        color: #404040;
        padding-top: 15rpx;
        padding-bottom: 18rpx;
    }
    .img-box{
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }
    .img{
        width: 311rpx;
        height: 190rpx;
        border-radius: 10rpx;
        margin-right: 15rpx;
        margin-bottom: 15rpx;
    }
    .img:nth-child(2n){
        margin-right: 0;
    }
    
    .text{
        padding: 30rpx 0;
        white-space: pre-line;
        word-break: break-all;
    }
    

</style>
